import Button from "components/Base/Button";
import Icon from "components/Base/Icon";
import DataTable from "components/Base/DataTable";
import Image from "components/Base/Image";
import {drpStateDict} from "../../../../models/DrpState";
import {collectionTypeDict} from "../../../../models/CollectionType";
import {cashStateDict} from "../../../../models/CashState";
import moment from "moment";

export default (self) => [

  {
    title: 'id',
    name: 'id',
    formItem: {
      type: 'hidden',
    }
  },
  {
    title: '昵称/姓名',
    name: 'name',
    tableItem: {
    },
  },

  {
    title: '电话',
    name: 'mobile',
    tableItem: {
    },
  },

  {
    title: '收款方式',
    name: 'payWay',
    tableItem: {
    },
    dict: collectionTypeDict,
  },

  {
    title: '收款账号',
    name: 'payAccount',
    tableItem: {
    },
  },

  {
    title: '金额',
    name: 'amount',
    tableItem: {
    },
  },

  {
    title: '状态',
    name: 'cashState',
    tableItem: {
    },
    formItem: {
      rules: [
        {
          required: true,
          message: '请选择状态'
        }
      ],

      showSearch: true,
      type: 'select',
    },
    dict: cashStateDict,
  },

  {
    title: '提交时间',
    name: 'createTime',
    tableItem: {
    },
  },

  {
    title: '转账时间',
    name: 'cashTime',
    tableItem: {
    },
    formItem: {
      type: 'datetime',
      showTime: true,
      initialValue: moment(),
      format: "YYYY-MM-DD HH:mm:ss"
    }
  },

  {
    title: '备注',
    name: 'remark',
    tableItem: {
    },
    formItem: {

    }
  },


  {
    title: '操作',
    tableItem: {
      width: 180,
      align: 'center',
      render: (text, record) => (
        <DataTable.Oper>
          <Button tooltip="修改" onClick={e => self.onUpdate(record)}>
            <Icon type="edit"/>
          </Button>
          {/*<Button tooltip="删除" onClick={e => self.onDelete(record)}>*/}
          {/*  <Icon type="trash"/>*/}
          {/*</Button>*/}
        </DataTable.Oper>
      )
    }
  }
]
